

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.ico">
  <link rel="icon" href="/img/favicon.ico">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="Try not to become a man of success but rather try to become a man of value. ">
  <meta name="author" content="kinzun">
  <meta name="keywords" content>
  <meta name="description" content="共享引用和增强赋值12345678#共享引用及在原处修改：对于可变对象，要注意尽量不要共享引用！    #共享引用和相等测试：        L = [1], M = [1], L is M            # 返回False        L = M = [1, 2, 3], L is M           # 返回True，共享引用#增强赋值和共享引用：普通+号会生成新的对象，而增强赋">
<meta name="keywords" content="Python">
<meta property="og:type" content="article">
<meta property="og:title" content="Python 深浅拷贝">
<meta property="og:url" content="https://kinzun.github.io/2018/09/17/深浅拷贝/index.html">
<meta property="og:site_name" content="kinzun">
<meta property="og:description" content="共享引用和增强赋值12345678#共享引用及在原处修改：对于可变对象，要注意尽量不要共享引用！    #共享引用和相等测试：        L = [1], M = [1], L is M            # 返回False        L = M = [1, 2, 3], L is M           # 返回True，共享引用#增强赋值和共享引用：普通+号会生成新的对象，而增强赋">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-10-29T09:26:31.072Z">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Python 深浅拷贝">
<meta name="twitter:description" content="共享引用和增强赋值12345678#共享引用及在原处修改：对于可变对象，要注意尽量不要共享引用！    #共享引用和相等测试：        L = [1], M = [1], L is M            # 返回False        L = M = [1, 2, 3], L is M           # 返回True，共享引用#增强赋值和共享引用：普通+号会生成新的对象，而增强赋">
  
  <title>Python 深浅拷贝 - kinzun</title>

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css">


  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css">
  <link rel="stylesheet" href="/lib/hint/hint.min.css">

  
    
    
      
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css">
    
  

  
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css">
  


<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">

<link rel="stylesheet" href="/css/main.css">

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"kinzun.github.io","root":"/","version":"1.8.12","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname"}},"search_path":"/local-search.xml"};
  </script>
  <script src="/js/utils.js"></script>
  <script src="/js/color-schema.js"></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>kinzun</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="Python 深浅拷贝">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2018-09-17 23:27" pubdate>
        2018年9月17日 晚上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.3k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      7 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Python 深浅拷贝</h1>
            
            <div class="markdown-body">
              <h5 id="共享引用和增强赋值"><a href="#共享引用和增强赋值" class="headerlink" title="共享引用和增强赋值"></a>共享引用和增强赋值</h5><figure class="highlight python"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs python"><span class="hljs-comment">#共享引用及在原处修改：对于可变对象，要注意尽量不要共享引用！</span><br>    <span class="hljs-comment">#共享引用和相等测试：</span><br>        L = [<span class="hljs-number">1</span>], M = [<span class="hljs-number">1</span>], L <span class="hljs-keyword">is</span> M            <span class="hljs-comment"># 返回False</span><br>        L = M = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], L <span class="hljs-keyword">is</span> M           <span class="hljs-comment"># 返回True，共享引用</span><br><span class="hljs-comment">#增强赋值和共享引用：普通+号会生成新的对象，而增强赋值+=会在原处修改</span><br>        L = M = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]<br>        L = L + [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>]                      <span class="hljs-comment"># L = [1, 2, 3, 4], M = [1, 2]</span><br>        L += [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>]                         <span class="hljs-comment"># L = [1, 2, 3, 4], M = [1, 2, 3, 4]</span><br></code></pre></div></td></tr></table></figure>
<p>赋值简单的拷贝对象，两个id相同</p>
<p>转载自：会发光的二极管</p>
<p>原文链接：<a href="https://link.zhihu.com/?target=http%3A//www.jianshu.com/p/efa9dd51f5cc" target="_blank" rel="noopener">谈谈python中的深拷贝和浅拷贝</a></p>
<p>最近面试被问到python中深拷贝和浅拷贝的知识<br>这里进行下总结，以便今后复习<br>python中的深拷贝和浅拷贝和java里面的概念是一样的，所谓浅拷贝就是对引用的拷贝，所谓深拷贝就是对对象的资源的拷贝。<br>首先，对赋值操作我们要有以下认识：</p>
<ol>
<li>赋值是将一个对象的地址赋值给一个变量，让变量指向该地址（ 旧瓶装旧酒 ）。(共享引用)</li>
<li>修改不可变对象（<code>str</code>、<code>tuple</code>）需要开辟新的空间（不可变对象<strong>不能修改</strong>，<strong>只能替换</strong>）</li>
<li>修改可变对象（<code>list</code>等）不需要开辟新的空间</li>
</ol>
<ul>
<li>浅拷贝仅仅复制了容器中元素的地址</li>
</ul>
<p>  <code>b = a[:]</code>,<code>copy.copy(a)</code></p>
<figure class="highlight python"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs python"><span class="hljs-meta">&gt;&gt;&gt; </span>a=[<span class="hljs-string">'hello'</span>,[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>]]<br><span class="hljs-meta">&gt;&gt;&gt; </span>b=a[:] <span class="hljs-comment">#b = copy.copy(a)</span><br><span class="hljs-meta">&gt;&gt;&gt; </span>[id(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> a]<br>[<span class="hljs-number">55792504</span>, <span class="hljs-number">6444104</span>]<br><span class="hljs-meta">&gt;&gt;&gt; </span>[id(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> b]<br>[<span class="hljs-number">55792504</span>, <span class="hljs-number">6444104</span>]<br><span class="hljs-meta">&gt;&gt;&gt; </span>a[<span class="hljs-number">0</span>]=<span class="hljs-string">'world'</span><br><span class="hljs-meta">&gt;&gt;&gt; </span>a[<span class="hljs-number">1</span>].append(<span class="hljs-number">4</span>)<br><span class="hljs-meta">&gt;&gt;&gt; </span>print(a)<br>[<span class="hljs-string">'world'</span>, [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]]<br><span class="hljs-meta">&gt;&gt;&gt; </span>print(b)<br>[<span class="hljs-string">'hello'</span>, [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]]<br></code></pre></div></td></tr></table></figure>
<p>这里可以看出，未修改前，a和b中元素的地址都是相同的，不可变的hello<br>和可变的list地址都一样，说明浅拷贝知识将容器内的元素的地址复制了一份。这可以通过修改后，b中字符串没改变，但是list元素随着a相应改变得到验证。</p>
<blockquote>
<p>浅拷贝是在另一块地址中创建一个新的变量或容器，但是容器内的元素的地址均是源对象的元素的地址的拷贝。也就是说新的容器中指向了旧的元素（ 新瓶装旧酒 ）。</p>
</blockquote>
<ul>
<li>深拷贝，完全拷贝了一个副本，容器内部元素地址都不一样</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs python"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> copy <span class="hljs-keyword">import</span> deepcopy<br><span class="hljs-meta">&gt;&gt;&gt; </span>a=[<span class="hljs-string">'hello'</span>,[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>]]<br><span class="hljs-meta">&gt;&gt;&gt; </span>b=deepcopy(a)<br><span class="hljs-meta">&gt;&gt;&gt; </span>[id(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> a]<br>[<span class="hljs-number">55792504</span>, <span class="hljs-number">55645000</span>]<br><span class="hljs-meta">&gt;&gt;&gt; </span>[id(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> b]<br>[<span class="hljs-number">55792504</span>, <span class="hljs-number">58338824</span>]<br><span class="hljs-meta">&gt;&gt;&gt; </span>a[<span class="hljs-number">0</span>]=<span class="hljs-string">'world'</span><br><span class="hljs-meta">&gt;&gt;&gt; </span>a[<span class="hljs-number">1</span>].append(<span class="hljs-number">4</span>)<br><span class="hljs-meta">&gt;&gt;&gt; </span><br><span class="hljs-meta">&gt;&gt;&gt; </span>print(a)<br>[<span class="hljs-string">'world'</span>, [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]]<br><span class="hljs-meta">&gt;&gt;&gt; </span>print(b)<br>[<span class="hljs-string">'hello'</span>, [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>]]<br></code></pre></div></td></tr></table></figure>
<p>这里可以看出，深拷贝后，a和b的地址以及a和b中的元素地址均不同，这是完全拷贝的一个副本，修改a后，发现b没有发生任何改变，因为b是一个完全的副本，元素地址与a均不同，a修改不影响b。</p>
<blockquote>
<p>深拷贝是在另一块地址中创建一个新的变量或容器，同时容器内的元素的地址也是新开辟的，仅仅是值相同而已，是完全的副本。也就是说（ 新瓶装新酒 ）。</p>
</blockquote>
<p>转载自：会发光的二极管</p>
<p>原文链接：<a href="https://link.zhihu.com/?target=http%3A//www.jianshu.com/p/efa9dd51f5cc" target="_blank" rel="noopener">谈谈python中的深拷贝和浅拷贝</a></p>
<h2 id="自定义拷贝机制"><a href="#自定义拷贝机制" class="headerlink" title="自定义拷贝机制"></a>自定义拷贝机制</h2><p>使用 <code>_copy_</code> 和 <code>__deepcopy__</code> 可以完成对一个对象拷贝的定制。这里不展开了，有机会再探讨自定义拷贝。</p>
<h4 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h4><ul>
<li>Python中对象的赋值都是进行对象引用（内存地址）传递</li>
<li>使用<code>copy.copy()</code>，<code>a = lis[:]</code>可以进行对象的<strong>浅拷贝</strong>，它复制了对象，但对于对象中的元素，依然使用<strong>原始的引用.</strong>,内存地址相同</li>
<li>如果需要复制一个<strong>容器对象</strong> <strong>（<code>list</code>，<code>dict</code>等）</strong>，以及它里面的所有元素（包含元素的子元素），可以使用<code>copy.deepcopy()</code>进行深拷贝，创建了新的对象。</li>
<li>对于非容器类型（如<code>str</code>,<strong>数字、字符串、和其他’原子’类型的对象</strong>）没有被拷贝一说</li>
<li>如果元祖变量只包含原子类型对象，则不能深拷贝，看下面的例子</li>
</ul>
<p>####</p>
<figure class="highlight python"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs python"><br><span class="hljs-keyword">import</span> copy<br><br><span class="hljs-comment">#目的是更改数据后，原来的数据不变，而拷贝后的数据会随时更新！</span><br>dic = &#123;<br><span class="hljs-string">"cpu"</span>:[<span class="hljs-number">80</span>,],<br><span class="hljs-string">"mem"</span>:[<span class="hljs-number">80</span>,],<br><span class="hljs-string">"disk"</span>:[<span class="hljs-number">80</span>,]<br>&#125;<br>print(<span class="hljs-string">"before:"</span>,dic)<br><br><span class="hljs-comment">#new_dic = copy.copy(dic)     ##浅拷贝后的数据更新会把原来和新的字典内容的数据都更新！</span><br>shallow_cpy = copy.copy(dic) <span class="hljs-comment">#浅拷贝</span><br>shallow_cpy[<span class="hljs-string">'cpu'</span>] = <span class="hljs-number">532</span><br>print(<span class="hljs-string">'newshallow'</span>,shallow_cpy)<br>new_dic = copy.deepcopy(dic)   <span class="hljs-comment">##深拷贝只更新拷贝后的数据，而原来的数据保留不变！</span><br>new_dic[<span class="hljs-string">"cpu"</span>][<span class="hljs-number">0</span>] = <span class="hljs-number">50</span><br>print(dic)<br>print(new_dic)<br></code></pre></div></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs python">a = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>]<br>a[<span class="hljs-number">1</span>] = a<br>print(a[<span class="hljs-number">1</span>])<br><span class="hljs-comment">#打印结果</span><br> <br>[<span class="hljs-number">1</span>, [...]]<br></code></pre></div></td></tr></table></figure>
<p><a href="https://www.cnblogs.com/wilber2013/p/4645353.html" target="_blank" rel="noopener">图解深浅拷贝</a></p>
<p><a href="https://songlee24.github.io/2014/08/15/python-FAQ-02/" target="_blank" rel="noopener">区别</a></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/Python/">Python</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2018/09/20/python内置函数filter，map，lambda,递归/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">python内置函数filter，map，lambda,递归</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2018/09/12/字符编码（character encoding,fileoperate/">
                        <span class="hidden-mobile">Python编码，文件编码的操作</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                

              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
